<!--pay.wxml-->
<import src="../detail/detail"/>
<template is="{{template}}" data="{{my_toast_tip: my_toast_tip}}"/>
<view class="payPage">
    <view class="payMethod">
        <view  class="item" bindtap="select_pay" data-type='4'>
            <view class="left">
                <image src="{{imageUrl}}/pay_balance.png"></image>
                <text class="pay">
                    <text>余额支付:</text>
                    <text class="red">{{util.formatNum(balance)}}元</text>
                </text>
            </view>
            <image wx:if="{{payType==4}}" class="right" src="{{imageUrl}}/pay_select.png"></image>
            <image wx:else class="right" src="{{imageUrl}}/pay_unselect.png"></image>
            
        </view>
        <view class="item" bindtap="select_pay" data-type='1'>
            <view class="left">
                <image src="{{imageUrl}}/icon_wechat.png"></image>
                <text  class="pay">微信支付</text>
            </view>
            <image wx:if="{{payType==1}}" class="right" src="{{imageUrl}}/pay_select.png"></image>            
            <image wx:else class="right" src="{{imageUrl}}/pay_unselect.png"></image>
        </view>

    </view>
    <view class="productContainer">
        <view class="item" wx:for="{{obj.cartItems}}" wx:key="{{index}}">
            <image wx:if="{{item.goods.imgUrl}}" src="{{item.goods.imgUrl}}"></image>
            <image wx:else src="{{imageUrl}}/xiaomai.jpg"></image>
            <view class="info">
                <view class="title">
                    <image wx:if="{{item.promotionType==9}}" src="{{imageUrl}}/group_image.png"></image>
                    {{item.promotionType==9?item.promotionAlias:item.goods.goodsName}}
                    <!-- {{item.promotionName}}{{item.goods.goodsName}} -->
                    
                </view>
                <view class="pre_price">￥ {{util.formatNum(item.goods.price)}}
                    <text wx:if="{{item.promotionType==7}}">{{item.promotionAlias}}</text>
                </view>
            </view>
            <view class="num">x {{item.num}}</view>
        </view>
       
        <view class="product_footer">
            <view class="left">原价: {{util.formatNum(obj.originalPrice) }}元</view>
            <!-- <view class="left">原价: {{util.formatNum("100.00") }}元</view> -->
            
            <view class="right">现价:{{util.formatNum(obj.promotionPrice)}}元</view>
        </view>
    </view>
    <!-- <view class=""></view> -->
    <view class="payInfo">
        <text class="pay_tips">
            <text>还需付：</text>
            <text class="pay_price">{{util.formatNum (obj.promotionPrice)}}</text>
        </text>
        <text class="pay_sure" bindtap="doPay">确认</text>
    </view>
</view>
<wxs module="util">
    var formatNum=function(n){
        return Number(n)
    }
    module.exports = {
        formatNum : formatNum,
    }
</wxs>